home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
PET
/
S-Super PET
/
(s)t4.d64
/
LISTER.BAS
< prev
next >
Wrap
BASIC Source File
|
2009-01-18
|
1KB
|
59 lines
10 ! list contents of source files
12
14 on ioerr ignore
15
16 on eof
17 end_of_file% = 1
18 resume next
19 endon
20
30 print chr$(12); 'lister program beginning ...'
40
50 loop
60 print chr$(4); 'enter filename ';
70 linput filename$
80 if filename$ = '' then quit
90 call list_the_file
100 endloop
110
120 print chr$(4); '... lister program terminating'
130
140 stop
150
160
170 proc list_the_file
180
190 guess
200 open #2, filename$, input
210 if io_status <> 0 then quit
220 call do_the_list
230 admit
240 print 'unable to open file '; filename$
250 endguess
260
270 endproc
280
290
300 proc do_the_list
310
320 print chr$(12); '< beginning of file >'; chr$(4)
330 count = 21
335 end_of_file% = 0
340 loop
350 linput #2, record$
360 if end_of_file% then quit
370 print record$
380 count = count - 1
390 if count = 0
400 print 'continue ';
410 linput response$
420 print chr$(12)
430 count = 21
440 endif
450 endloop
460 print chr$(4); '< end of file >'
470 close #2
480
490 endproc
500